A communication network, such as a local area network WLAN, a wireless sensor network WSN, near field communication NFC, radio frequency identification RFID and a personal area network WPAN, is susceptible to be attacked such as being forged, tapped and replayed during communication. Therefore, it needs to authenticate identities of both parties of the communication before communication, so as to ensure legality of the identities of the both parties of the communication. Presently, in a solution based on a cipher algorithm particularly a symmetric cipher algorithm, since identities of both parties are generally not confirmed during an authentication process, it can be only determined that the other party has a certain shared secret even if the identity authentication is successful while the true identity of the other party still cannot be determined actually, resulting in a certain potential security risk.